/*
 * @Author: your name
 * @Date: 2022-01-19 13:58:07
 * @LastEditTime: 2024-08-26 16:52:53
 * @LastEditors: 陈宇 975155172@qq.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \k2c_admin_web\src\api\login\index.ts
 */
import type { ListDataParam, abstractParam, LoginResult, abstractDetailsParam } from './model';

import axios from '@/axios';

/**
 * 文章列表
 */
export const abstractList = async (data: abstractParam) => {
  // return await axios.post<PageResult<ListDataParam>>({ url: '/api/abstract/list', data });
  
  const res = await axios.post<PageResult<ListDataParam>>({ url: '/api/abstract/list', data });
  if (res.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.message || ''));
}


// /**
//  * 文章详情
//  */
export const abstractDetails = async (data: abstractDetailsParam) => {
  const res = await axios.post<IResponse<LoginResult>>({ url: '/api/abstract/details', data });
  if (res.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.message || ''));
}